
module.exports = function main(distance,wait) {
    let cost=getDistanceCost(distance)+getWaitCost(wait);
    cost=Math.round(cost);
    return cost;
};

function getDistanceCost(distance){
    let distanceCost=0; 
    if(distance<=2){
        distanceCost=6;
    }
    if(distance>2&&distance<=8){
        distanceCost=6+(distance-2)*0.8;
    }
    if(distance>8){
        distanceCost=10.8+(distance-8)*0.8*1.5;
    }
    return distanceCost;
}

function getWaitCost(wait){
    let waitCost=0;
    waitCost=0.25*wait;
    return waitCost;
}